package cn.tedu.commpro.controller.product.category.controller;

import cn.tedu.commpro.controller.product.category.service.ProductCategoryService;
import org.ecshop.common.domain.productcenter.ProductCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "ecshop/v1/manage/productDetail/get_Category")
public class ProductCategoryController {

	@Autowired
	private ProductCategoryService productCategoryService;

	/**
	 * 查询所有商品分类
	 */
	@RequestMapping(value = "/getProductOneCategory", method = RequestMethod.POST)
	public List<ProductCategory> getProductOneCategory(@RequestParam(value = "id",defaultValue = "0") Long pcPid) {
		if (pcPid==null){
			pcPid=0L;
		}
		return productCategoryService.selectProductCategoryByPcPId(pcPid);
	}



}
